<template>
  <a-card :bordered='false' class='card-area'>
    <!-- 查询区域 11111-->
    <div class='table-page-search-wrapper'>
      <a-form layout='inline' :label-col='labelCol' @keyup.enter.native='searchQuery'>
        <a-row :gutter='24'>
          <a-col :md='6' :sm='8'>
            <a-form-item label='活动周期'>
              <a-select v-model='queryParam.cycle' placeholder='请选择活动周期'>
                <a-select-option value=''>请选择</a-select-option>
                <a-select-option value='1'>短期</a-select-option>
                <a-select-option value='2'>长期</a-select-option>
              </a-select>

            </a-form-item>
          </a-col>
          <span style='float: left;overflow: hidden;' class='table-page-search-submitButtons'>
           <a-col :md='6' :sm='24'>
               <a-button type='primary' @click='searchQuery' icon='search'>查询</a-button>
               <a-button type='primary' @click='searchReset' icon='reload' style='margin-left: 8px'>重置</a-button>
           </a-col>
        </span>
        </a-row>
      </a-form>
    </div>

    <!-- 操作按钮区域 -->
    <div class='table-operator'>
<!--      <a-button @click='handleAdd' type='primary' icon='plus'>新增</a-button>-->
    </div>

    <!-- table区域-begin -->
    <div>

      <a-table
        ref='table'
        size='middle'
        bordered
        rowKey='id'
        :columns='columns'
        :dataSource='dataSource'
        :pagination='ipagination'
        :loading='loading'
        @change='handleTableChange'>

        <span slot='action' slot-scope='text, record'>
          <a @click='handleEdit(record)'>编辑</a>

<!--          <a-divider type='vertical' />-->
<!--          <a-dropdown>-->
<!--            <a class='ant-dropdown-link'>更多 <a-icon type='down' /></a>-->
<!--                <a-menu slot='overlay'>-->
<!--                      <a-menu-item>-->
<!--                        <a-popconfirm title='确定删除吗?' @confirm='() => handleDelete(record.id)'>-->
<!--                          <a>删除</a>-->
<!--                        </a-popconfirm>-->
<!--                      </a-menu-item>-->
<!--                </a-menu>-->
<!--          </a-dropdown>-->
        </span>

      </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <hHisActivityType-modal ref='modalForm' @ok='modalFormOk'></hHisActivityType-modal>
  </a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import HHisActivityTypeModal from './modules/HHisActivityTypeModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { putAction, getAction, postAction } from '@/api/manage'
import { frozenBatch } from '@/api/api'

export default {
  name: 'h_his_activity_typeList',
  mixins: [JeecgListMixin],
  components: {
    HHisActivityTypeModal
  },
  data() {
    return {
      description: '活动类型管理页面',
      labelCol: { style: { width: '110px' } },
      // 表头
      columns: [
        {
          title: '活动类型',
          align: 'center',
          dataIndex: 'name'
        },
        {
          title: '活动周期',
          align: 'center',
          dataIndex: 'cycle',
          customRender: function(t, r, index) {
            return t == '1' ? '短期' : '长期'
          }
        },
        {
          title: '备注',
          align: 'center',
          dataIndex: 'remark'
        },
        {
          title: '创建时间',
          align: 'center',
          dataIndex: 'createTime'
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: '/his/activity/type/list',
        delete: '/his/activity/type/delete',
      }
    }
  },
  computed: {
    importExcelUrl: function() {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    }
  },
  methods: {}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>